/**
 * I.java
 * Copyright (C) 2010 Yuanyan<yuanyan.cao@gmail.com>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * For information on how to redistribute this software under
 * the terms of a license other than GNU General Public License
 * contact yuanyan.cao@gmail.com
 */
package edu.rabbit.kernel.fs;

import edu.rabbit.DbException;

/**
 * 
 * The list of all registered {@link IFileSystem} implementations.
 * 
 * @author Yuanyan<yanyan.cao@gmail.com>
 * 
 * 
 */
public interface IFileSystemsManager {

    /**
     * Locate a {@link IFileSystem} by name. If no name is given, simply return the
     * default {@link IFileSystem}.
     * 
     * @param name
     * @return
     */
    IFileSystem find(final String name);

    /**
     * Register a {@link IFileSystem} with the system.  It is harmless to register the same
     * {@link IFileSystem} multiple times.  The new {@link IFileSystem} becomes 
     * the default if isDefault is true.
     * 
     * @param fs
     * @param isDefault
     * @throws DbException 
     */
    void register(final IFileSystem fs, final boolean isDefault) throws DbException;

    /**
     * Unregister a {@link IFileSystem} so that it is no longer accessible.
     * 
     * 
     * @param fs
     * @throws DbException 
     */
    void unregister(final IFileSystem fs) throws DbException;

}
